Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(battery): Add Kconfig setting for battery level report interval #1303

Merged
merged 1 commit into from
May 17, 2022

Conversation

caksoylar
Copy link
Contributor

Makes the interval between BAS GATT reports for battery level configurable using a new CONFIG_ZMK_BATTERY_REPORT_INTERVAL setting. Related: #1273 (comment)

There are a few decisions I made that I am not 100% sure of, comments welcome:

  • Location of Kconfig: right now this is under the battery driver, but it could be under app/Kconfig (in a new submenu under "Basic keyboard setup"?) or is there a better spot?
  • Name of setting: I didn't mention BAS GATT since it is not very familiar to users. Should it have "level" in the name?
  • Should the delay until first report also be configurable, or equal to the interval? I thought there isn't much use in making this configurable and 1 minute seems like a good value.
  • Unit of interval: Minutes might be too coarse, milliseconds might be too fine, so I chose seconds.

@petejohanson
Copy link
Contributor

Thanks!

There are a few decisions I made that I am not 100% sure of, comments welcome:

* Location of Kconfig: right now this is under the battery driver, but it could be under `app/Kconfig` (in a new submenu under "Basic keyboard setup"?) or is there a better spot?

Should definitely not be with the driver, since is app code consuming the driver. app/Kconfig somewhere is good.

* Name of setting: I didn't mention BAS GATT since it is not very familiar to users. Should it have "level" in the name?

I think the name you used is fine, IMHO.

* Should the delay until first report also be configurable, or equal to the interval? I thought there isn't much use in making this configurable and 1 minute seems like a good value.

I wouldn't complicate it that much. Just one setting is fine.

* Unit of interval: Minutes might be too coarse, milliseconds might be too fine, so I chose seconds.

Agreed on seconds being the right unit here.

@caksoylar
Copy link
Contributor Author

Thanks for the comments! I moved the setting to app/Kconfig under the Advanced submenu, which sounded appropriate.

Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@petejohanson petejohanson merged commit 25f89ee into zmkfirmware:main May 17, 2022
@caksoylar caksoylar deleted the battery-report-interval branch May 17, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants